package com.zyong.design.pattern.observer.case3;

import java.util.Observable;
import java.util.Observer;

/**
 * @program: zyong-design-pattern
 * @ClassName: Policemen
 * @author: zyong
 * @create: 2024-05-15 00:19
 */
public class Policemen implements Observer {
    private String name;

    public Policemen(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public void update(Observable o, Object arg) {
        System.out.println(name + ":" + ((Thief) o).getName() + ",我已经盯你很久了,你可以保持沉默,但你所说的将成为呈堂证供!!!");
    }
}
